import request from './request'

// 获取图片列表
export const getImageList = (params) => {
  return request({
    url: '/upload/image/list',
    method: 'get',
    params
  })
}

// 获取单个图片信息
export const getImageInfo = (id) => {
  return request({
    url: `/upload/image/${id}`,
    method: 'get'
  })
}

// 上传图片
export const uploadImage = (data) => {
  return request({
    url: '/upload/image',
    method: 'post',
    data
  })
}


// 修改图片信息
export const updateImageInfo = (id, data) => {
  return request({
    url: `/upload/image/${id}`,
    method: 'put',
    data
  })
}

// 删除图片
export const deleteImage = (id) => {
  return request({
    url: `/upload/image`,
    method: 'delete',
    data: { id }
  })
}

// 批量删除图片
export const batchDeleteImages = (data) => {
  return request({
    url: '/upload/image/batch',
    method: 'post',
    data
  })
}

// 批量修改图片信息
export const batchUpdateImageInfo = (data) => {
  return request({
    url: '/upload/image/batch',
    method: 'put',
    data
  })
}

